Skip to content

test(core): cover manual compaction cancellation - #45335

Closed
kitlangton wants to merge 2 commits into
v2from
manual-compaction
Closed

test(core): cover manual compaction cancellation#45335
kitlangton wants to merge 2 commits into
v2from
manual-compaction

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Why

Manual compaction must settle a delivered control even if interruption arrives before summary execution begins. It must also leave the inbox available for mutations while the model is running. Existing streaming-cancellation tests did not pin down these two cases.

What Changes

Add two runner regression tests using the existing fixture and TestLLM:

Scenario Required result
Interrupt after delivery/start, before summary entry No model request; the inbox item is consumed; exactly one aborted compaction settlement follows delivery/start
Cancel queued input while summary execution is gated Cancellation completes before the summary is released; the compaction remains running, then completes normally

The tests use explicit gates and the test clock rather than wall-clock sleeps. The inbox test times out only its completion observer and always releases the summary gate.

Scope

The earlier production extraction has been removed. This is now test-only: one file, 81 added lines, no new helpers. Runner/Compaction ownership, interruption handling, interfaces, and existing fixtures are unchanged.

Verification

# packages/core
bun run test test/session-compaction.test.ts test/config/compaction.test.ts test/session-runner.test.ts
bun run test test/session-runner.test.ts --test-name-pattern 'after delivery before summary entry|allows inbox cancellation' --rerun-each 10 --concurrent --max-concurrency 4
bun run test
bun typecheck

# worktree root
bunx prettier --check packages/core/test/session-runner.test.ts
bunx oxlint packages/core/test/session-runner.test.ts
bunx ast-grep scan -c script/ast-grep/effect-simplifications/sgconfig.yml --off=unused-suppression packages/core/test/session-runner.test.ts
git diff 2ce126e2df...HEAD --check
  • Focused compaction/config/runner suites: 185 passed, 674 assertions.
  • New regressions, ten concurrent repetitions each: 20 passed, 100 assertions, against unchanged production code.
  • Full Core: 3,768 passed, 39 skipped, 0 failed, 78,802 assertions across 220 files.
  • Core typecheck, formatting, Effect scan, and whitespace checks passed. Oxlint reported no errors and three existing warnings.
  • An AST audit confirms all pre-existing runner tests and fixture code are unchanged; only the two named regressions were added.
  • Cleanup reviews found no actionable reuse, quality, or lifecycle issues. Normal pre-push verification passed all 33 workspace typecheck tasks (27 cached), without bypassing hooks.

Local verification ran on macOS. Fresh CI is running for tests-only head c476515eb1; the previous extraction revision's green CI is not claimed as verification of this head. Auto-merge remains disabled.

@kitlangton kitlangton changed the title refactor(core): centralize manual compaction lifecycle refactor(core): centralize manual compaction settlement Aug 28, 2026
@kitlangton kitlangton changed the title refactor(core): centralize manual compaction settlement test(core): cover manual compaction cancellation Aug 28, 2026
@kitlangton kitlangton closed this Aug 28, 2026
@kitlangton
kitlangton deleted the manual-compaction branch August 28, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant